{include file="public/head"/}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">用户协议</div>
                <div class="layui-card-body" pad15>
                    <div class="layui-form" wid100 lay-filter="form">

                        <div class="layui-form-item">
                            <label class="layui-form-label">协议内容</label>
                            <div class="layui-input-block">
                                {include file="public/editor" name="detail" /}
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="edit">确认保存</button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/foot"/}
<script>
    layui.config({
        base: '__LAYADMIN__/',version: true
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','form','admin'],function(){
        /*表单操作*/
        var form = layui.form, admin = layui.admin
        form.on('submit(edit)', function (data) {
            var form_data = data.field;
            form_data.detail = editor.getContent()
            admin.req({
                url: '/admin/System/treaty'
                , type: 'post'
                , data: form_data
                , done: function (res) {
                    layer.msg(res.msg, {icon: 1, time: 1000}, function () {
                        location.reload();
                    });
                }
            });
        });
    });
</script>
</body>
</html>
